<!DOCTYPE html>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page="/pad/common/commonCss.jsp"/>
<jsp:include page="/pad/common/commonJs.jsp"/>
<!-- 统一提示js -->
<%-- <script  type="text/javascript" src="${basePath }pad/commonJs/message.js"></script>
 --%><script  type="text/javascript" src="${basePath }pad/commonJs/jt_map.js"></script>
<script  type="text/javascript" src="${basePath}pad/commonJs/tags/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	$("#modiTimedis").val('${parreserveOld.pmodiTime}');
	loadTypeTimeValue();
	loadParTaocan();
	addTrFujia();//加载附加菜单，ajax
	addTrming();//获取装饰物信息
	var parstatus ='${parreserveOld.resStatus}';
	 var zbBranidOld='${zbBranid}';
	if( parstatus=='2'|| parstatus =='3'||  zbBranidOld=='ZB'){//已确认
		 $("#bgenggai").hide();
	}
});


function genggai(){
	var partype ='${parType}';
	var pkParresIdOld ='${pkParresId}';
	  pkOrderIdOld ='guanliType@${pkOrderId}';
	if(partype =='1'){
		window.location.href="${basePath }parreserve/toPadTuanTiReserveNew.shtml?parType=1&pkParresId="+pkParresIdOld+"&pkOrderId="+pkOrderIdOld;
	}
	else{
		window.location.href="${basePath }parreserve/toPadReserveNew.shtml?parType=0&pkParresId="+pkParresIdOld+"&pkOrderId="+pkOrderIdOld;
	}
}

//加载搭配套餐
function loadParTaocan(){
	var arr =[];
	var divIdP="openCengValid('#q')";
	var divopen ='"open"';
	var taocanSize='${gblScmTaocanSize}';
	arr.push('<table class="table">');
	if('${listGblScmTaocan}'!='[]'){
	<c:forEach items="${listGblScmTaocan}" var="parTaocan" varStatus="status">
		<c:choose>
			<c:when test="${status.index==0}">
				arr.push('<tr><td>主食1</td><td>${parTaocan.cateName}：${parTaocan.prdName} </td>');
			</c:when>
			<c:when test="${status.index==1 }">
				arr.push('<tr><td>主食2</td><td>${parTaocan.cateName}：${parTaocan.prdName} </td></tr>');
			</c:when>
			<c:when test="${status.index==2 && parTaocan.fkPrdcateId=='001007001002'}">
				arr.push('<tr><td>主食3</td><td>${parTaocan.cateName}：${parTaocan.prdName} </td></tr>');
			</c:when>
			<c:otherwise>
				 arr.push('<tr><td>${parTaocan.cateName}</td><td>${parTaocan.prdName} </td></tr>');
			</c:otherwise>
		</c:choose>
	</c:forEach>
	}
	arr.push('</table>');
	var parTaocanDiv = document.getElementById("parTaocan");
	parTaocanDiv.innerHTML = arr.join('');
}
//获取附加菜单的信息
function addTrFujia() {
	var  basicPkg2=$("#addbasicPkg2").val();
	$.ajax({
		url:"${basePath }parreserve/addPageFujia.shtml?addType=fujia",
		dataType:"json",
		data:{"pageNo":"1","pageSize":"400","basicPkg2":basicPkg2},
		type:"post",
		async:false,
		success:function(data){
			if(data.results!=null){
				$.each(data.results,function(ind,obj){
					var htm="<tr>";
					htm+="<td>"+obj.prdName+"</td>";
					htm+=" <td>"+obj.productPrice+"</td>";
					var quantCount =obj.quantity;
					if(quantCount==null){
						quantCount=0;
					}
					htm+='<td><input value="'+quantCount+'" type="text" name="qty" id="qty'+obj.pkPrdId+'" disabled class="iput_t w50"   ></td>';
					htm+='<td>&nbsp;</td>';
					htm+="</tr>";
					 $("#addfujiaTable").find("tr:eq("+ind+")").after(htm);
				});
			}
		}
	});
}
//获取装饰物的信息
function addTrming() {
	var  addbasicPkg3=$("#addbasicPkg3").val();
	$.ajax({
		url:"${basePath }parreserve/addPageZhuangshi.shtml?addType=zhuangs",
		dataType:"json",
		data:{"pageNo":"1","pageSize":"400","basicPkg3":addbasicPkg3},
		type:"post",
		async:false,
		success:function(data){
			if(data.results!=null){
				$.each(data.results,function(ind,obj){
					var htm="<tr>";
					htm+="<td>"+obj.prdName+"</td>";
					htm+=" <td>"+obj.productPrice+"</td>";
					var quantCount =obj.quantity;
					if(quantCount==null){
						quantCount=0;
					}
					htm+='<td><input value="'+quantCount+'" type="text" name="zhuangshiTr" id="zhuangshiTr'+obj.pkPrdId+'" disabled class="iput_t w50"   ></td>';
					htm+='<td>&nbsp;</td>';
					htm+="</tr>";
					 $("#addtrimmingtable").find("tr:eq("+ind+")").after(htm);
				});
			}
		}
	});
}

//加载时间
function loadTypeTimeValue(){
	var resTimeS='${parreserveOld.resTimeS}';
	var resTimeE='${parreserveOld.resTimeE}';
	/* var parCtypeId ='${parreserveOld.fkPartypeId}';
	var overTime ='${parreserveOld.overTime}';
	if(overTime==1){
		$("#overTime").val("1小时");
	}else if(overTime==2){
		$("#overTime").val("2小时");
	}
	 <c:forEach items="${cTypeList}" var="cType" varStatus="status">
	 if('${cType.pkPartypeId}'==parCtypeId){
		 $("#fkPartypeId").val('${cType.parType}');
	 }
     </c:forEach> */
	 var paiduikTime =resTimeS.substring(0, 2)+":"+resTimeS.substring(2, 4)+"-"+resTimeE.substring(0, 2)+":"+resTimeE.substring(2, 4);
     $("#paidukaishi").val(paiduikTime);
}
</script>
<title>嘉童游乐中心</title>
</head>
<body class="bg">
<div class="top"><a class="icon iconfont fl ml10"  href="${basePath}parreserve/reservationPage.shtml">&#xe612;</a>${parreserveOld.subject}</div>
<div class="i_index fixed">
<div class="i_index_z fl oh">
    	<ul class="i_index_tab m20 fixed" id="tab_c">
            <li class="border_radius_l">派对信息</li>
            <li>搭配套餐</li>
            <li>附加菜单</li>
            <li class="border_radius_r">装饰用品</li>
        </ul>
        
        <div class="clear"></div>
        <ul id="tab_conbox_c">
        	<li>
            	<div class="mana_reg_dl_x fl">
            		<input type="hidden" name="basicPkg2" id="addbasicPkg2" value="${parreserveOld.basicPkg2}">
            		<input type="hidden" name="basicPkg3" id="addbasicPkg3" value="${parreserveOld.basicPkg3}"> 
                    <dl class="mt30 f14">
                        <dt><label>派对主题：</label><input type="text" class="iput_t w200" disabled="disabled"   value="${parreserveOld.subject}"></dt>
                        <dt><label>儿童姓名：</label><input type="text"  value="${parreserveOld.chdName}" disabled="disabled"    class="iput_t w200"></dt>
                        <dt><label>联系人：</label><input type="text" class="iput_t w200"  value="${parreserveOld.conName}" disabled="disabled" ></dt>
                        <dt><label>固话：</label><input type="text" class="iput_t w200"  value="${parreserveOld.conTel}" disabled="disabled"></dt>
                        <dt><label>手机：</label><input type="text" class="iput_t w200"  value="${parreserveOld.conMobile}" disabled="disabled"></dt>
                        <dt><label>Email：</label><input type="text" class="iput_t w200"   value="${parreserveOld.conEmail}" disabled="disabled"></dt>
                        <dt><label>房间：</label>
                        		<input type="text"  value="${parreserveOld.roomIds}"   class="iput_t w200" disabled>
                        </dt>
                        <dt><label>预约日期：</label>
                        	<input type="text"    disabled="disabled"  value="${parreserveOld.presDay}"  class="iput_t w200">
                        </dt>
                        <dt><label>预约时间：</label>
                        	                    <input disabled="disabled" type="text" class="iput_t w200"    name="paidukaishi" id="paidukaishi">
                        </dt>
                        <dt><label>人数：</label><input type="text" class="iput_t w200"   value="${parreserveOld.resMemCnt}" disabled="disabled"></dt>
                        <dt><label class="vt">备注：</label><textarea class="textare w200"  disabled="disabled">${parreserveOld.comments}</textarea></dt>
                        <dt><label>操作时间：</label>
									<input type="text" name="modiTimedis" id="modiTimedis" class=" iput_t w200"    disabled="disabled">
                        </dt>
                        <dt><label>操作人：</label><input type="text"   class=" iput_t w200" value="${modiName}"   disabled="disabled" ></dt>
                   		
                    </dl>
                </div>
                <div class="clear"></div>
                <div class="btm_btn mt10">
	                <dl>
	                	<dd><input type="button" id="bgenggai" value="更改" class="btn" onClick="genggai()"></dd>
	                </dl>
                </div>
            </li>
            <li class="dsly_n"  style="display: none;">
            	<div class="zhushi" id="parTaocan">
            		
                </div>
            </li>
            <!-- 附加菜单 -->
            <li style="display: none;">
            	<div class="zhushi">
                	<table class="table" id="addfujiaTable">
                    	<tr>
                        	<th>商品</th>
                            <th>价格(￥)</th>
                            <th>数量</th>
                            <th>操作</th>
                        </tr>
                    </table>
                </div>
            </li>
            <!-- 装饰物 -->
            <li class="dsly_n" style="display: none;">
            	<div class="zhushi">
            	<table class="table"  id="addtrimmingtable">
	                <tr>
	                    <th>商品</th>
	                    <th>价格(元)</th>
	                    <th>数量</th>
	                    <th>操作</th>
	                </tr>
            </table>
                </div>
            </li>
        </ul>		
        <!---内容--->
    </div>
</div>
<!---修改套餐--->
<div id="q" class="easyui-window" title="修改套餐" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:840px; height:650px; position:relative;">
	
    <div class="order_add_yix fixed">
        <dl>
            <dt>已选主食：</dt>
            <dd>组合迷你三明治（6 个/份）<a href="#" class=" delete_icon fr"></a></dd>
            <dd>鳕鱼汉堡（6 个/份）<a href="#" class=" delete_icon fr"></a></dd>
            <dd>蔬菜炒饭（1份）<a href="#" class=" delete_icon fr"></a></dd>
        </dl>
        <dl>
            <dt>已选配菜：</dt>
            <dd>土豆泥 （1份）<a href="#" class=" delete_icon fr"></a></dd>
        </dl>
        <dl>
            <dt>已选饮料：</dt>
            <dd>已选饮料：矿泉水 （1瓶）<a href="#" class=" delete_icon fr"></a></dd>
        </dl>
    </div>
    
    <div class="taocan">
            <ul class="i_index_tab  m20 fixed" id="tab_d">
                <li class="border_radius_l">主餐(选3)</li>
                <li>配菜(选1)</li>
                <li class="border_radius_r">饮料(选1)</li>
            </ul>
            <div class="clear"></div>
            <ul id="tab_conbox_d">
                
            </ul>
    	</div>
    <div class="btm_btn btm_bg">
    	<dl>
        	<dd><input type="button" class="btn" onClick="javascript:closeDiv('order_add_x.html','save')" value="确定"></dd>
            <dd><input type="button" class="btn" onclick="alertWarning()" onClick="javascript:closeDiv('order_add_x.html','')" value="取消"></dd>
        </dl>
    </div>
</div>
<!---修改套餐--->
<!---新增装饰物--->
<div id="p" class="easyui-window" title="新增装饰物" data-options="modal:true,closed:true,iconCls:'icon-save'" style="width:820px; height:400px; position:relative;">
	
    <div class="m10">
    	 
    </div>
    <div class="btm_btn btm_bg">
    	<dl>
        	<dd><input type="button" class="btn" onClick="javascript:closeDiv('order_add.html','save')" value="确定"></dd>
            <dd><input type="button" class="btn" onClick="javascript:closeDiv('order_add.html','')" value="取消"></dd>
        </dl>
    </div>
</div>
<!---新增装饰物--->
</body>
</html>